include Makefile.def

CFLAGS += -I./aliens/libharu-2.1.0/include -I./aliens/libharu-2.1.0/win32/include

DLLFLAGS=

########### zlib ###################
SRCS = \
	aliens/zlib/adler32.c \
	aliens/zlib/compress.c \
	aliens/zlib/crc32.c \
	aliens/zlib/deflate.c \
	aliens/zlib/gzio.c \
	aliens/zlib/infback.c \
	aliens/zlib/inffast.c \
	aliens/zlib/inflate.c \
	aliens/zlib/inftrees.c \
	aliens/zlib/trees.c \
	aliens/zlib/uncompr.c \
	aliens/zlib/zutil.c 

######## lib HARU #############	
SRCS += \
	aliens/libharu-2.1.0/src/hpdf_array.c \
	aliens/libharu-2.1.0/src/hpdf_annotation.c \
	aliens/libharu-2.1.0/src/hpdf_binary.c \
	aliens/libharu-2.1.0/src/hpdf_boolean.c \
	aliens/libharu-2.1.0/src/hpdf_catalog.c \
	aliens/libharu-2.1.0/src/hpdf_doc.c \
	aliens/libharu-2.1.0/src/hpdf_destination.c \
	aliens/libharu-2.1.0/src/hpdf_dict.c \
	aliens/libharu-2.1.0/src/hpdf_encoder.c \
	aliens/libharu-2.1.0/src/hpdf_encoder_cns.c \
	aliens/libharu-2.1.0/src/hpdf_encoder_cnt.c \
	aliens/libharu-2.1.0/src/hpdf_encrypt.c \
	aliens/libharu-2.1.0/src/hpdf_encryptdict.c \
	aliens/libharu-2.1.0/src/hpdf_error.c \
	aliens/libharu-2.1.0/src/hpdf_ext_gstate.c \
	aliens/libharu-2.1.0/src/hpdf_font.c \
	aliens/libharu-2.1.0/src/hpdf_font_cid.c \
	aliens/libharu-2.1.0/src/hpdf_fontdef_base14.c \
	aliens/libharu-2.1.0/src/hpdf_fontdef.c \
	aliens/libharu-2.1.0/src/hpdf_fontdef_cid.c \
	aliens/libharu-2.1.0/src/hpdf_fontdef_cns.c \
	aliens/libharu-2.1.0/src/hpdf_fontdef_cnt.c \
	aliens/libharu-2.1.0/src/hpdf_fontdef_tt.c \
	aliens/libharu-2.1.0/src/hpdf_fontdef_type1.c \
	aliens/libharu-2.1.0/src/hpdf_font_tt.c \
	aliens/libharu-2.1.0/src/hpdf_font_type1.c \
	aliens/libharu-2.1.0/src/hpdf_gstate.c \
	aliens/libharu-2.1.0/src/hpdf_image.c \
	aliens/libharu-2.1.0/src/hpdf_info.c \
	aliens/libharu-2.1.0/src/hpdf_list.c \
	aliens/libharu-2.1.0/src/hpdf_mmgr.c \
	aliens/libharu-2.1.0/src/hpdf_name.c \
	aliens/libharu-2.1.0/src/hpdf_null.c \
	aliens/libharu-2.1.0/src/hpdf_number.c \
	aliens/libharu-2.1.0/src/hpdf_objects.c \
	aliens/libharu-2.1.0/src/hpdf_outline.c \
	aliens/libharu-2.1.0/src/hpdf_page_label.c \
	aliens/libharu-2.1.0/src/hpdf_page_operator.c \
	aliens/libharu-2.1.0/src/hpdf_pages.c \
	aliens/libharu-2.1.0/src/hpdf_real.c \
	aliens/libharu-2.1.0/src/hpdf_streams.c \
	aliens/libharu-2.1.0/src/hpdf_string.c \
	aliens/libharu-2.1.0/src/hpdf_utils.c \
	aliens/libharu-2.1.0/src/hpdf_xref.c \
	aliens/libharu-2.1.0/src/hpdf_xref.c \
	
################# lib argtable2 ##############################
SRCS += \
	aliens/argtable2-12/src/argtable2.c \
	aliens/argtable2-12/src/arg_lit.c \
	aliens/argtable2-12/src/arg_end.c \
	aliens/argtable2-12/src/arg_int.c \
	aliens/argtable2-12/src/arg_file.c \
	aliens/argtable2-12/src/arg_str.c \


OBJS	=  $(addprefix ${BUILD}/, $(SRCS:.c=.o))

${BUILD}/%.o: %.c	
	@$(MKDIR) ${BUILD}/aliens/zlib ${BUILD}/aliens/libharu-2.1.0/src ${BUILD}/aliens/quicklz  ${BUILD}/aliens/argtable2-12/src 
	$(CC) $(OPTS) $(CFLAGS) $(DLLFLAGS) -c ${COMPILIER_OUT}$@ $<


EXCELSRCS = \
	aliens/excel/BasicExcel.cpp \
	 
EXCELOBJS	=  $(addprefix ${BUILD}/, $(EXCELSRCS:.cpp=.oo))

${BUILD}/%.oo: %.cpp %.hpp	
	@$(MKDIR) ${BUILD}/aliens/excel   
	$(CC) $(OPTS) $(CFLAGS) $(DLLFLAGS) -c ${COMPILIER_OUT}$@ $<


${BUILD}/lib/aliens.a: $(OBJS) $(EXCELOBJS)
	$(MKDIR) ${BUILD}/lib
	$(AR) -rcs ${BUILD}/lib/aliens.a $^
	@echo "Haru has been built"

aliens: ${BUILD}/lib/aliens.a

	
all: aliens
	
clean:
	$(RM) -rf ${BUILD}/aliens
	
	